/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Model.Dao;
import Model.Entity.FolderInfo;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
 *
 * @author Trung
 */
public class FolderDao {
    public List<FolderInfo> getAll(){
        DataAccess da = new DataAccess();
        List<FolderInfo> listCa = new ArrayList<FolderInfo>();
        try {
            da.ps = da.con.prepareStatement("select * from Category");
            da.rs = da.ps.executeQuery();
            while(da.rs.next()){
                listCa.add(new FolderInfo(da.rs.getInt(1),da.rs.getString(2),da.rs.getInt(3)));
            }
        } catch (SQLException ex) {
            Logger.getLogger(CategoryDao.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        return listCa;       
    }
}
